
import task from "../../../models/dict/task.js"  //任务字典模块
import clType from "../../../models/dict/clothesSizeType"  //任务字典模块
import array from "../../../models/comm/array.js"  //数组操作模块
import py from '../../../models/comm/webPy';
import axios from 'axios';
import Vue from 'vue'
import dFlow from '../../../models/dict/flow';
import nodeShow from './nodeShow.vue';
import yz from '../../../models/comm/yz';
import taskInfoShow from '../task/taskInfoShow.vue';
export default {


    data: function () {


        return {
            list: [],
            taskList: []

        }
    },

    methods: {

        show(node) {

            node.show = true
            console.log("node.show为true");

        },

        getTaskClassName(taskClssId) {

            return task.getClassName(taskClssId)
        },


        getNodeList() {


        },
        getJd(node) {

            return dFlow.getJd(node)
        },
        getStatusStr(node) {

            return dFlow.getStatusStr(node)


        },
        getTaskList() {

            var nodeIdList = [];
            this.nodeList.forEach(function (node) {
                nodeIdList.push(node.id);
                if (!node.show) {
                    Vue.set(node, "show", false)

                }
            }, this);
            axios.post("/a", {
                class: "task",
                para: "getTaskList",
                j: {
                    data: {

                        customerOrderId: this.customerOrder._id,
                        flowClassId: this.dataType,
                        nodeId: { $in: nodeIdList }

                    }
                }

            }).then((res) => {

                this.taskList = res.data.list



                //    console.log(JSON.stringify(this.taskList));

            });

        },
        show1(node) {

            this.nodeList.forEach(function (element) {
                Vue.set(element, "show", false)
            }, this);
            Vue.set(node, "show", true)
  
        }




    },
    props: ["nodeList", "customerOrder", "dataType"],
    mounted() {
        //在这里进一步获取任务列表悬停每个任务


        this.getTaskList();



    },
    components: {
        taskInfoShow
    }



}